//
//  XML.m
//
//  Created by Fabio Yasusi Yamamoto <fyy@mac.com> on 08/19/10.
//  Copyright 2010 Appyx. All rights reserved.
//  


#include <libxml/xmlmemory.h>
#include <libxml/parser.h>
#include <libxml/xmlreader.h>

#import <Foundation/Foundation.h>

@interface XML : NSObject {
	NSMutableDictionary * dicXML;
	xmlDocPtr doc;
	xmlNodePtr element_root;
}

@property ( retain, nonatomic ) NSMutableDictionary * dicXML;
@property ( assign ) xmlDocPtr doc;
@property ( assign ) xmlNodePtr element_root;

/* private */
-(NSMutableDictionary *)_parseNode:(xmlNodePtr )node;
-(NSMutableDictionary *)_parseNode:(xmlNodePtr )node name:(NSString *)name;
+(NSMutableArray *)getXMLElementArray:(NSMutableArray *)array name:(NSString *)name;
+(NSMutableDictionary *)getXMLElement:(NSMutableArray *)array name:(NSString *)name;
+(NSString *)getXMLElementValue:(NSMutableArray *)array name:(NSString *)name;


/* public */
-(id) query:(NSString *)query;
-(id)initWithString:(NSString *)text;

@end
